#include "stdafx.h"
#include "linklist_test.h"

int linklist_test::_random_toll = 0;
LockFreeList<int>::iterator* linklist_test::_it = nullptr;

//---------------------------------------------------------------------------
void linklist_test::test_init()
{
	_list = std::make_unique<LockFreeList<int>>();
}
//---------------------------------------------------------------------------
void linklist_test::do_test()
{
	_random_toll = _input_gen();
	
	_it = new LockFreeList<int>::iterator(_list->begin());

	_list->insert(*_it, _random_toll);
	
	if(_force_context_switch)
	{
		::SwitchToThread();
	}

	_list->delete_node(*_it);

	delete _it;
}
//---------------------------------------------------------------------------
std::string linklist_test::test_name(void)
{
	return "LockFreeList";
}
//---------------------------------------------------------------------------
